<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">

</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="a()" >1</a>
		<a href="#" onclick="b()" >2</a>
		<a href="#" onclick="c()" >3</a>
		<a href="#" onclick="d()" >4</a>
		<a href="#" onclick="e()" >5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
</body>
<script>
	function a(){
		img.setAttribute("src","/JavaScript/JavaScript操作DOM对象/习题/1/images/1.gif");
	}
	function b(){
		img.setAttribute("src","/JavaScript/JavaScript操作DOM对象/习题/1/images/2.gif");
	}
	function c(){
		img.setAttribute("src","/JavaScript/JavaScript操作DOM对象/习题/1/images/3.jpg");
	}
	function d(){
		img.setAttribute("src","/JavaScript/JavaScript操作DOM对象/习题/1/images/4.jpg");
	}
	function e(){
		img.setAttribute("src","/JavaScript/JavaScript操作DOM对象/习题/1/images/5.gif");
	}
	var img=document.getElementById("photo");
</script>
</html>
